(define powerset
   [ ] -> [[ ]]  
   [X | Y] -> (append (cons-X-to-each-set X (powerset Y)) (powerset Y)))

(define cons-X-to-each-set  
    _ [ ] -> [ ]  
    X [Y | Z] -> [[X | Y] | (cons-X-to-each-set X Z)])








 

